{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "08287760",
   "metadata": {},
   "source": [
    "· 日期：2023-5-25\\week14(周四)\n",
    "\n",
    "· 课程：API、机器学习与人工智能\n",
    "\n",
    "· 记录人：林荣烽"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a63e3fef",
   "metadata": {},
   "source": [
    "# 初识地图\n",
    "1. 地图API简介（Web服务）\n",
    "2. 如何选择合适的API（开发支持）\n",
    "3. 权衡经济成本和产品设计成本（调用量和并发量思考，经济成本考量）\n",
    "4. 设计地图url需求\n",
    "5. 测试API功能"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ae7a4ef5",
   "metadata": {},
   "source": [
    "# Web服务API简介 \n",
    "* 高德Web服务API向开发者提供HTTP接口，开发者可通过这些接口使用各类型的地理数据服务，返回结果支持JSON和XML格式。Web服务API对所有用户开放。使用本组服务之前，需要申请应用Key。不同类型用户可获取不同的数据访问能力。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "36b244be",
   "metadata": {},
   "source": [
    "## 地理/逆地理编码\n",
    "\n",
    "* 结构化地址:\n",
    "> 首先，地址肯定是一串字符，内含国家、省份、城市、区县、城镇、乡村、街道、门牌号码、屋邨、大厦等建筑物名称。按照由大区域名称到小区域名称组合在一起的字符。一个有效的地址应该是独一无二的。注意：针对大陆、港、澳地区的地理编码转换时可以将国家信息选择性的忽略，但省、市、城镇等级别的地址构成是不能忽略的。暂时不支持返回台湾省的详细地址信息。\n",
    "\n",
    "* 结构化地址<--->经纬度\n",
    "> 地理编码/逆地理编码 API 是通过 HTTP/HTTPS 协议访问远程服务的接口，提供结构化地址与经纬度之间的相互转化的能力"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "5d460f39",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 调用requests模块（google chrome 浏览器）\n",
    "import requests\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. URL地址 ： https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "geo_url = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"b0121f143057c2f0c3607e48fe21bac9\",\n",
    "    \"address\":\"广东省广州市从化区广州南方学院\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=geo_url, params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "8bddf4f7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "3a1cbf88",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'geocodes': [{'formatted_address': '广东省广州市从化区温泉镇中心大学南方学院',\n",
       "   'country': '中国',\n",
       "   'province': '广东省',\n",
       "   'citycode': '020',\n",
       "   'city': '广州市',\n",
       "   'district': '从化区',\n",
       "   'township': [],\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'adcode': '440117',\n",
       "   'street': [],\n",
       "   'number': [],\n",
       "   'location': '113.678280,23.628439',\n",
       "   'level': '兴趣点'}]}"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "68d9e1a4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.678280,23.628439'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院_location = r.json()['geocodes'][0]['location']\n",
    "广州南方学院_location"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "103a41b0",
   "metadata": {},
   "source": [
    "### 逆地理编码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "118b00b0",
   "metadata": {},
   "outputs": [],
   "source": [
    "# extensions=base（默认）\n",
    "# 1. 调用requests模块（google chrome 浏览器）\n",
    "import requests\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. URL地址 ： https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "regeo_url = \"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"b0121f143057c2f0c3607e48fe21bac9\",\n",
    "    \"location\":广州南方学院_location\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=regeo_url, params=payload)    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "e530f79b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "e3258747",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'regeocode': {'addressComponent': {'city': '广州市',\n",
       "   'province': '广东省',\n",
       "   'adcode': '440117',\n",
       "   'district': '从化区',\n",
       "   'towncode': '440117100000',\n",
       "   'streetNumber': {'number': '24号',\n",
       "    'location': '113.677267,23.629149',\n",
       "    'direction': '西北',\n",
       "    'distance': '129.943',\n",
       "    'street': '博学路'},\n",
       "   'country': '中国',\n",
       "   'township': '温泉镇',\n",
       "   'businessAreas': [[]],\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'citycode': '020'},\n",
       "  'formatted_address': '广东省广州市从化区温泉镇博学路广州南方学院'},\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000'}"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "cd3437ac",
   "metadata": {},
   "outputs": [],
   "source": [
    "# extensions=all \n",
    "# 1. 调用requests模块（google chrome 浏览器）\n",
    "import requests\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. URL地址 ： https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "regeo_url = \"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"b0121f143057c2f0c3607e48fe21bac9\",\n",
    "    \"location\":广州南方学院_location,\n",
    "    \"extensions\":\"all\",\n",
    "    \"poitype\":\"true\",\n",
    "    \n",
    "    \n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url=regeo_url, params=payload) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "2acd4729",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "0a6e9ccc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'regeocode': {'formatted_address': '广东省广州市从化区温泉镇博学路广州南方学院',\n",
       "  'addressComponent': {'country': '中国',\n",
       "   'province': '广东省',\n",
       "   'city': '广州市',\n",
       "   'citycode': '020',\n",
       "   'district': '从化区',\n",
       "   'adcode': '440117',\n",
       "   'township': '温泉镇',\n",
       "   'towncode': '440117100000',\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'streetNumber': {'street': '博学路',\n",
       "    'number': '24号',\n",
       "    'location': '113.677267,23.629149',\n",
       "    'direction': '西北',\n",
       "    'distance': '129.943'},\n",
       "   'businessAreas': [[]]},\n",
       "  'pois': [{'id': 'B00140MR9A',\n",
       "    'name': '广州南方学院',\n",
       "    'type': '科教文化服务;学校;高等院校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '470.792',\n",
       "    'location': '113.679257,23.632577',\n",
       "    'address': '温泉镇温泉大道882号',\n",
       "    'poiweight': '0.450402',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFK8J7XY',\n",
       "    'name': '广州南方学院(东南门)',\n",
       "    'type': '通行设施;临街院门;临街院门',\n",
       "    'tel': [],\n",
       "    'direction': '东',\n",
       "    'distance': '44.279',\n",
       "    'location': '113.678689,23.628304',\n",
       "    'address': '温泉镇温泉大道882号广州南方学院',\n",
       "    'poiweight': '0.233244',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFHRJDM9',\n",
       "    'name': '中南公寓',\n",
       "    'type': '商务住宅;住宅区;住宅小区',\n",
       "    'tel': '13711245345',\n",
       "    'direction': '东南',\n",
       "    'distance': '231.223',\n",
       "    'location': '113.680340,23.627566',\n",
       "    'address': '中大南方学院南门1号',\n",
       "    'poiweight': '0.256152',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0GKYRKNUA',\n",
       "    'name': '乐妍茶(中大店)',\n",
       "    'type': '餐饮服务;冷饮店;冷饮店',\n",
       "    'tel': '18028862548',\n",
       "    'direction': '东南',\n",
       "    'distance': '205.173',\n",
       "    'location': '113.680097,23.627643',\n",
       "    'address': '温泉镇平岗村乌土平岗街25号(中南公寓旁)',\n",
       "    'poiweight': '0.209893',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFG4TAF2',\n",
       "    'name': '广州南方公寓',\n",
       "    'type': '住宿服务;旅馆招待所;旅馆招待所',\n",
       "    'tel': '13622768437',\n",
       "    'direction': '东南',\n",
       "    'distance': '102.617',\n",
       "    'location': '113.678983,23.627778',\n",
       "    'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
       "    'poiweight': '0.237309',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFHC4XU0',\n",
       "    'name': '中山大学南方学院学术交流中心',\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '285.635',\n",
       "    'location': '113.679959,23.630496',\n",
       "    'address': '温泉大道886号',\n",
       "    'poiweight': '0.191595',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFLF90I2',\n",
       "    'name': '煌上煌酱鸭(广州南方学院店)',\n",
       "    'type': '餐饮服务;快餐厅;快餐厅',\n",
       "    'tel': '13712317721',\n",
       "    'direction': '东北',\n",
       "    'distance': '256.772',\n",
       "    'location': '113.679965,23.630156',\n",
       "    'address': '笃行路20、22、24号广州南方学院商业中心1层1F015',\n",
       "    'poiweight': '0.209448',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFKP838K',\n",
       "    'name': '教学楼3号(外国语学院)',\n",
       "    'type': '科教文化服务;学校;高等院校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '298.093',\n",
       "    'location': '113.677247,23.630947',\n",
       "    'address': '博学路25号',\n",
       "    'poiweight': '0.191742',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0H33OZ7BU',\n",
       "    'name': '中山大学南方学院学术报告厅',\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '312.056',\n",
       "    'location': '113.678698,23.631219',\n",
       "    'address': '博学路广州南方学院',\n",
       "    'poiweight': '0.191148',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFKP7GY5',\n",
       "    'name': '广州南方学院3号实验楼',\n",
       "    'type': '地名地址信息;门牌信息;楼栋号',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '244.566',\n",
       "    'location': '113.678650,23.630612',\n",
       "    'address': '温泉镇温泉大道882号',\n",
       "    'poiweight': '0.218221',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFL7NUA2',\n",
       "    'name': '湖边纸包鱼',\n",
       "    'type': '餐饮服务;中餐厅;四川菜(川菜)',\n",
       "    'tel': '13924024938',\n",
       "    'direction': '东北',\n",
       "    'distance': '260.939',\n",
       "    'location': '113.679861,23.630285',\n",
       "    'address': '广州南方学院',\n",
       "    'poiweight': '0.224259',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0IB2GMPW4',\n",
       "    'name': '古茗(南方学院店)',\n",
       "    'type': '餐饮服务;休闲餐饮场所;休闲餐饮场所',\n",
       "    'tel': '18027267535',\n",
       "    'direction': '东北',\n",
       "    'distance': '311.024',\n",
       "    'location': '113.680105,23.630681',\n",
       "    'address': '温泉镇笃行路20、22、24号中山大学南方学院商业中心一楼1F-005',\n",
       "    'poiweight': '0.218331',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0H25SMRKP',\n",
       "    'name': '广州南方学院大礼堂',\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '386.65',\n",
       "    'location': '113.680076,23.631502',\n",
       "    'address': '温泉镇温泉大道882号广州南方学院',\n",
       "    'poiweight': '0.263595',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFKP81F0',\n",
       "    'name': '教学楼1号(文学与传媒学院)',\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '393.93',\n",
       "    'location': '113.676866,23.631736',\n",
       "    'address': '博学路与中山路交叉口南340米',\n",
       "    'poiweight': '0.191742',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU99RM',\n",
       "    'name': '广州南方学院图书馆',\n",
       "    'type': '科教文化服务;图书馆;图书馆',\n",
       "    'tel': '020-61787368;020-61787371',\n",
       "    'direction': '北',\n",
       "    'distance': '444.196',\n",
       "    'location': '113.679303,23.632322',\n",
       "    'address': '温泉大道882号广州南方学院内',\n",
       "    'poiweight': '0.257947',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFH6K3U9',\n",
       "    'name': '广州中大南方招待所',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关',\n",
       "    'tel': '020-61787222',\n",
       "    'direction': '西北',\n",
       "    'distance': '378.102',\n",
       "    'location': '113.676330,23.631332',\n",
       "    'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
       "    'poiweight': '0.254885',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0H1YMW8PH',\n",
       "    'name': '肯德基(从化南方学院店)',\n",
       "    'type': '餐饮服务;快餐厅;快餐厅',\n",
       "    'tel': '4009200715',\n",
       "    'direction': '西北',\n",
       "    'distance': '419.018',\n",
       "    'location': '113.676031,23.631594',\n",
       "    'address': '温泉镇中山大学南方学院博学路6号西区食堂首层',\n",
       "    'poiweight': '0.214311',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD58NF8',\n",
       "    'name': '广州南方学院达人书院',\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '446.366',\n",
       "    'location': '113.679041,23.632392',\n",
       "    'address': '温泉大道882号广州南方学院新综合楼2层',\n",
       "    'poiweight': '0.191229',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFKUVYWV',\n",
       "    'name': '和风庭阿七度假别墅(博学路分店)',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关',\n",
       "    'tel': '+861056320612,4618482',\n",
       "    'direction': '东北',\n",
       "    'distance': '424.35',\n",
       "    'location': '113.681736,23.630569',\n",
       "    'address': '保利桃花源',\n",
       "    'poiweight': '0.273168',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0JBGSCQ5R',\n",
       "    'name': '广州南方学院招待所',\n",
       "    'type': '住宿服务;旅馆招待所;旅馆招待所',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '405.49',\n",
       "    'location': '113.675341,23.630898',\n",
       "    'address': '温泉镇温泉大道882号广州南方学院',\n",
       "    'poiweight': '0.276093',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFIXV3OZ',\n",
       "    'name': '广州南方学院第一食堂',\n",
       "    'type': '餐饮服务;中餐厅;中餐厅',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '450.091',\n",
       "    'location': '113.675848,23.631818',\n",
       "    'address': '温泉镇广州南方学院博学路6号',\n",
       "    'poiweight': '0.182221',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFL7C054',\n",
       "    'name': '广州U优森特酒店',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关',\n",
       "    'tel': '15813395296',\n",
       "    'direction': '北',\n",
       "    'distance': '464.819',\n",
       "    'location': '113.679226,23.632528',\n",
       "    'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
       "    'poiweight': '0.317505',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFHHKASW',\n",
       "    'name': '栗子家蛋糕店',\n",
       "    'type': '餐饮服务;糕饼店;糕饼店',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '471.03',\n",
       "    'location': '113.679283,23.632574',\n",
       "    'address': '温泉镇广州南方学院后门润泰超市1层',\n",
       "    'poiweight': '0.210069',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFHQXIPV',\n",
       "    'name': '惠仁轩cafe(图书馆店)',\n",
       "    'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '501.323',\n",
       "    'location': '113.678800,23.632922',\n",
       "    'address': '温泉大道882号广州南方学院行政楼1号',\n",
       "    'poiweight': '0.155825',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0H6ZUSDBT',\n",
       "    'name': '80后铁板烧',\n",
       "    'type': '餐饮服务;外国餐厅;外国餐厅',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '484.588',\n",
       "    'location': '113.679405,23.632673',\n",
       "    'address': '温泉镇广州南方学院后门润泰超市1层05号商铺',\n",
       "    'poiweight': '0.230225',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFG8CSEK',\n",
       "    'name': 'L5员工宿舍',\n",
       "    'type': '商务住宅;住宅区;宿舍',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '554.129',\n",
       "    'location': '113.682583,23.631487',\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.185371',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0GUJYPEG2',\n",
       "    'name': '怒烤烤串(从化店)',\n",
       "    'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '510.112',\n",
       "    'location': '113.677160,23.632910',\n",
       "    'address': '温泉大道882号广州南方学院内博学路6号之3号',\n",
       "    'poiweight': '0.216026',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFLJV97L',\n",
       "    'name': '保利桃花源83栋',\n",
       "    'type': '地名地址信息;门牌信息;楼栋号',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '476.46',\n",
       "    'location': '113.682290,23.630644',\n",
       "    'address': '温泉镇',\n",
       "    'poiweight': '0.106856',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD580NZ',\n",
       "    'name': '广州南方学院惟贤门',\n",
       "    'type': '科教文化服务;学校;高等院校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '587.601',\n",
       "    'location': '113.678437,23.633721',\n",
       "    'address': '博学路7号附近',\n",
       "    'poiweight': '0.285712',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HR0GQOU0',\n",
       "    'name': '中山大学南方学院继续教育学院',\n",
       "    'type': '科教文化服务;学校;成人教育',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '659.946',\n",
       "    'location': '113.677666,23.634347',\n",
       "    'address': '博学路中山大学南方学院-行政楼',\n",
       "    'poiweight': '0.191158',\n",
       "    'businessarea': []}],\n",
       "  'roads': [{'id': '020F49F0050461206',\n",
       "    'name': '博学路',\n",
       "    'direction': '北',\n",
       "    'distance': '7.63232',\n",
       "    'location': '113.678,23.6284'},\n",
       "   {'id': '020F49F0050462229',\n",
       "    'name': '老虎形街',\n",
       "    'direction': '北',\n",
       "    'distance': '445.159',\n",
       "    'location': '113.679,23.6245'},\n",
       "   {'id': '020F49F005046601453',\n",
       "    'name': '中山路',\n",
       "    'direction': '南',\n",
       "    'distance': '712.706',\n",
       "    'location': '113.677,23.6347'}],\n",
       "  'roadinters': [{'direction': '南',\n",
       "    'distance': '691.177',\n",
       "    'location': '113.676745,23.634493',\n",
       "    'first_id': '020F49F0050461206',\n",
       "    'first_name': '博学路',\n",
       "    'second_id': '020F49F005046601453',\n",
       "    'second_name': '中山路'}],\n",
       "  'aois': [{'id': 'B00140MR9A',\n",
       "    'name': '广州南方学院',\n",
       "    'adcode': '440117',\n",
       "    'location': '113.679257,23.632577',\n",
       "    'area': '528560.656426',\n",
       "    'distance': '0',\n",
       "    'type': '141201'}]}}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "14937bed",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "c0e4450e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>type</th>\n",
       "      <th>tel</th>\n",
       "      <th>direction</th>\n",
       "      <th>distance</th>\n",
       "      <th>location</th>\n",
       "      <th>address</th>\n",
       "      <th>poiweight</th>\n",
       "      <th>businessarea</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B00140MR9A</td>\n",
       "      <td>广州南方学院</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>470.792</td>\n",
       "      <td>113.679257,23.632577</td>\n",
       "      <td>温泉镇温泉大道882号</td>\n",
       "      <td>0.450402</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B0FFK8J7XY</td>\n",
       "      <td>广州南方学院(东南门)</td>\n",
       "      <td>通行设施;临街院门;临街院门</td>\n",
       "      <td>[]</td>\n",
       "      <td>东</td>\n",
       "      <td>44.279</td>\n",
       "      <td>113.678689,23.628304</td>\n",
       "      <td>温泉镇温泉大道882号广州南方学院</td>\n",
       "      <td>0.233244</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B0FFHRJDM9</td>\n",
       "      <td>中南公寓</td>\n",
       "      <td>商务住宅;住宅区;住宅小区</td>\n",
       "      <td>13711245345</td>\n",
       "      <td>东南</td>\n",
       "      <td>231.223</td>\n",
       "      <td>113.680340,23.627566</td>\n",
       "      <td>中大南方学院南门1号</td>\n",
       "      <td>0.256152</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B0GKYRKNUA</td>\n",
       "      <td>乐妍茶(中大店)</td>\n",
       "      <td>餐饮服务;冷饮店;冷饮店</td>\n",
       "      <td>18028862548</td>\n",
       "      <td>东南</td>\n",
       "      <td>205.173</td>\n",
       "      <td>113.680097,23.627643</td>\n",
       "      <td>温泉镇平岗村乌土平岗街25号(中南公寓旁)</td>\n",
       "      <td>0.209893</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B0FFG4TAF2</td>\n",
       "      <td>广州南方公寓</td>\n",
       "      <td>住宿服务;旅馆招待所;旅馆招待所</td>\n",
       "      <td>13622768437</td>\n",
       "      <td>东南</td>\n",
       "      <td>102.617</td>\n",
       "      <td>113.678983,23.627778</td>\n",
       "      <td>温泉镇乌土村松浪队5号(近博学路)</td>\n",
       "      <td>0.237309</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>B0FFHC4XU0</td>\n",
       "      <td>中山大学南方学院学术交流中心</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>285.635</td>\n",
       "      <td>113.679959,23.630496</td>\n",
       "      <td>温泉大道886号</td>\n",
       "      <td>0.191595</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>B0FFLF90I2</td>\n",
       "      <td>煌上煌酱鸭(广州南方学院店)</td>\n",
       "      <td>餐饮服务;快餐厅;快餐厅</td>\n",
       "      <td>13712317721</td>\n",
       "      <td>东北</td>\n",
       "      <td>256.772</td>\n",
       "      <td>113.679965,23.630156</td>\n",
       "      <td>笃行路20、22、24号广州南方学院商业中心1层1F015</td>\n",
       "      <td>0.209448</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>B0FFKP838K</td>\n",
       "      <td>教学楼3号(外国语学院)</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>298.093</td>\n",
       "      <td>113.677247,23.630947</td>\n",
       "      <td>博学路25号</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>B0H33OZ7BU</td>\n",
       "      <td>中山大学南方学院学术报告厅</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>312.056</td>\n",
       "      <td>113.678698,23.631219</td>\n",
       "      <td>博学路广州南方学院</td>\n",
       "      <td>0.191148</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>B0FFKP7GY5</td>\n",
       "      <td>广州南方学院3号实验楼</td>\n",
       "      <td>地名地址信息;门牌信息;楼栋号</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>244.566</td>\n",
       "      <td>113.678650,23.630612</td>\n",
       "      <td>温泉镇温泉大道882号</td>\n",
       "      <td>0.218221</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>B0FFL7NUA2</td>\n",
       "      <td>湖边纸包鱼</td>\n",
       "      <td>餐饮服务;中餐厅;四川菜(川菜)</td>\n",
       "      <td>13924024938</td>\n",
       "      <td>东北</td>\n",
       "      <td>260.939</td>\n",
       "      <td>113.679861,23.630285</td>\n",
       "      <td>广州南方学院</td>\n",
       "      <td>0.224259</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>B0IB2GMPW4</td>\n",
       "      <td>古茗(南方学院店)</td>\n",
       "      <td>餐饮服务;休闲餐饮场所;休闲餐饮场所</td>\n",
       "      <td>18027267535</td>\n",
       "      <td>东北</td>\n",
       "      <td>311.024</td>\n",
       "      <td>113.680105,23.630681</td>\n",
       "      <td>温泉镇笃行路20、22、24号中山大学南方学院商业中心一楼1F-005</td>\n",
       "      <td>0.218331</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>B0H25SMRKP</td>\n",
       "      <td>广州南方学院大礼堂</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>386.65</td>\n",
       "      <td>113.680076,23.631502</td>\n",
       "      <td>温泉镇温泉大道882号广州南方学院</td>\n",
       "      <td>0.263595</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>B0FFKP81F0</td>\n",
       "      <td>教学楼1号(文学与传媒学院)</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "      <td>[]</td>\n",
       "      <td>西北</td>\n",
       "      <td>393.93</td>\n",
       "      <td>113.676866,23.631736</td>\n",
       "      <td>博学路与中山路交叉口南340米</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>B0HGDU99RM</td>\n",
       "      <td>广州南方学院图书馆</td>\n",
       "      <td>科教文化服务;图书馆;图书馆</td>\n",
       "      <td>020-61787368;020-61787371</td>\n",
       "      <td>北</td>\n",
       "      <td>444.196</td>\n",
       "      <td>113.679303,23.632322</td>\n",
       "      <td>温泉大道882号广州南方学院内</td>\n",
       "      <td>0.257947</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>B0FFH6K3U9</td>\n",
       "      <td>广州中大南方招待所</td>\n",
       "      <td>住宿服务;住宿服务相关;住宿服务相关</td>\n",
       "      <td>020-61787222</td>\n",
       "      <td>西北</td>\n",
       "      <td>378.102</td>\n",
       "      <td>113.676330,23.631332</td>\n",
       "      <td>温泉镇温泉大道882号广州南方学院H7栋1-5层</td>\n",
       "      <td>0.254885</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>B0H1YMW8PH</td>\n",
       "      <td>肯德基(从化南方学院店)</td>\n",
       "      <td>餐饮服务;快餐厅;快餐厅</td>\n",
       "      <td>4009200715</td>\n",
       "      <td>西北</td>\n",
       "      <td>419.018</td>\n",
       "      <td>113.676031,23.631594</td>\n",
       "      <td>温泉镇中山大学南方学院博学路6号西区食堂首层</td>\n",
       "      <td>0.214311</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>B0HGD58NF8</td>\n",
       "      <td>广州南方学院达人书院</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>446.366</td>\n",
       "      <td>113.679041,23.632392</td>\n",
       "      <td>温泉大道882号广州南方学院新综合楼2层</td>\n",
       "      <td>0.191229</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>B0FFKUVYWV</td>\n",
       "      <td>和风庭阿七度假别墅(博学路分店)</td>\n",
       "      <td>住宿服务;住宿服务相关;住宿服务相关</td>\n",
       "      <td>+861056320612,4618482</td>\n",
       "      <td>东北</td>\n",
       "      <td>424.35</td>\n",
       "      <td>113.681736,23.630569</td>\n",
       "      <td>保利桃花源</td>\n",
       "      <td>0.273168</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>B0JBGSCQ5R</td>\n",
       "      <td>广州南方学院招待所</td>\n",
       "      <td>住宿服务;旅馆招待所;旅馆招待所</td>\n",
       "      <td>[]</td>\n",
       "      <td>西北</td>\n",
       "      <td>405.49</td>\n",
       "      <td>113.675341,23.630898</td>\n",
       "      <td>温泉镇温泉大道882号广州南方学院</td>\n",
       "      <td>0.276093</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>B0FFIXV3OZ</td>\n",
       "      <td>广州南方学院第一食堂</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>[]</td>\n",
       "      <td>西北</td>\n",
       "      <td>450.091</td>\n",
       "      <td>113.675848,23.631818</td>\n",
       "      <td>温泉镇广州南方学院博学路6号</td>\n",
       "      <td>0.182221</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>B0FFL7C054</td>\n",
       "      <td>广州U优森特酒店</td>\n",
       "      <td>住宿服务;住宿服务相关;住宿服务相关</td>\n",
       "      <td>15813395296</td>\n",
       "      <td>北</td>\n",
       "      <td>464.819</td>\n",
       "      <td>113.679226,23.632528</td>\n",
       "      <td>温泉镇博学路882号(广州南方学院商业中心1层)</td>\n",
       "      <td>0.317505</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>B0FFHHKASW</td>\n",
       "      <td>栗子家蛋糕店</td>\n",
       "      <td>餐饮服务;糕饼店;糕饼店</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>471.03</td>\n",
       "      <td>113.679283,23.632574</td>\n",
       "      <td>温泉镇广州南方学院后门润泰超市1层</td>\n",
       "      <td>0.210069</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>B0FFHQXIPV</td>\n",
       "      <td>惠仁轩cafe(图书馆店)</td>\n",
       "      <td>餐饮服务;餐饮相关场所;餐饮相关</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>501.323</td>\n",
       "      <td>113.678800,23.632922</td>\n",
       "      <td>温泉大道882号广州南方学院行政楼1号</td>\n",
       "      <td>0.155825</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>B0H6ZUSDBT</td>\n",
       "      <td>80后铁板烧</td>\n",
       "      <td>餐饮服务;外国餐厅;外国餐厅</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>484.588</td>\n",
       "      <td>113.679405,23.632673</td>\n",
       "      <td>温泉镇广州南方学院后门润泰超市1层05号商铺</td>\n",
       "      <td>0.230225</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>B0FFG8CSEK</td>\n",
       "      <td>L5员工宿舍</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>554.129</td>\n",
       "      <td>113.682583,23.631487</td>\n",
       "      <td>从莞深高速(广州南方学院)</td>\n",
       "      <td>0.185371</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>B0GUJYPEG2</td>\n",
       "      <td>怒烤烤串(从化店)</td>\n",
       "      <td>餐饮服务;中餐厅;特色/地方风味餐厅</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>510.112</td>\n",
       "      <td>113.677160,23.632910</td>\n",
       "      <td>温泉大道882号广州南方学院内博学路6号之3号</td>\n",
       "      <td>0.216026</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>B0FFLJV97L</td>\n",
       "      <td>保利桃花源83栋</td>\n",
       "      <td>地名地址信息;门牌信息;楼栋号</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>476.46</td>\n",
       "      <td>113.682290,23.630644</td>\n",
       "      <td>温泉镇</td>\n",
       "      <td>0.106856</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>B0HGD580NZ</td>\n",
       "      <td>广州南方学院惟贤门</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>587.601</td>\n",
       "      <td>113.678437,23.633721</td>\n",
       "      <td>博学路7号附近</td>\n",
       "      <td>0.285712</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>B0HR0GQOU0</td>\n",
       "      <td>中山大学南方学院继续教育学院</td>\n",
       "      <td>科教文化服务;学校;成人教育</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>659.946</td>\n",
       "      <td>113.677666,23.634347</td>\n",
       "      <td>博学路中山大学南方学院-行政楼</td>\n",
       "      <td>0.191158</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            id              name                  type  \\\n",
       "0   B00140MR9A            广州南方学院        科教文化服务;学校;高等院校   \n",
       "1   B0FFK8J7XY       广州南方学院(东南门)        通行设施;临街院门;临街院门   \n",
       "2   B0FFHRJDM9              中南公寓         商务住宅;住宅区;住宅小区   \n",
       "3   B0GKYRKNUA          乐妍茶(中大店)          餐饮服务;冷饮店;冷饮店   \n",
       "4   B0FFG4TAF2            广州南方公寓      住宿服务;旅馆招待所;旅馆招待所   \n",
       "5   B0FFHC4XU0    中山大学南方学院学术交流中心  科教文化服务;科教文化场所;科教文化场所   \n",
       "6   B0FFLF90I2    煌上煌酱鸭(广州南方学院店)          餐饮服务;快餐厅;快餐厅   \n",
       "7   B0FFKP838K      教学楼3号(外国语学院)        科教文化服务;学校;高等院校   \n",
       "8   B0H33OZ7BU     中山大学南方学院学术报告厅  科教文化服务;科教文化场所;科教文化场所   \n",
       "9   B0FFKP7GY5       广州南方学院3号实验楼       地名地址信息;门牌信息;楼栋号   \n",
       "10  B0FFL7NUA2             湖边纸包鱼      餐饮服务;中餐厅;四川菜(川菜)   \n",
       "11  B0IB2GMPW4         古茗(南方学院店)    餐饮服务;休闲餐饮场所;休闲餐饮场所   \n",
       "12  B0H25SMRKP         广州南方学院大礼堂  科教文化服务;科教文化场所;科教文化场所   \n",
       "13  B0FFKP81F0    教学楼1号(文学与传媒学院)  科教文化服务;科教文化场所;科教文化场所   \n",
       "14  B0HGDU99RM         广州南方学院图书馆        科教文化服务;图书馆;图书馆   \n",
       "15  B0FFH6K3U9         广州中大南方招待所    住宿服务;住宿服务相关;住宿服务相关   \n",
       "16  B0H1YMW8PH      肯德基(从化南方学院店)          餐饮服务;快餐厅;快餐厅   \n",
       "17  B0HGD58NF8        广州南方学院达人书院  科教文化服务;科教文化场所;科教文化场所   \n",
       "18  B0FFKUVYWV  和风庭阿七度假别墅(博学路分店)    住宿服务;住宿服务相关;住宿服务相关   \n",
       "19  B0JBGSCQ5R         广州南方学院招待所      住宿服务;旅馆招待所;旅馆招待所   \n",
       "20  B0FFIXV3OZ        广州南方学院第一食堂          餐饮服务;中餐厅;中餐厅   \n",
       "21  B0FFL7C054          广州U优森特酒店    住宿服务;住宿服务相关;住宿服务相关   \n",
       "22  B0FFHHKASW            栗子家蛋糕店          餐饮服务;糕饼店;糕饼店   \n",
       "23  B0FFHQXIPV     惠仁轩cafe(图书馆店)      餐饮服务;餐饮相关场所;餐饮相关   \n",
       "24  B0H6ZUSDBT            80后铁板烧        餐饮服务;外国餐厅;外国餐厅   \n",
       "25  B0FFG8CSEK            L5员工宿舍           商务住宅;住宅区;宿舍   \n",
       "26  B0GUJYPEG2         怒烤烤串(从化店)    餐饮服务;中餐厅;特色/地方风味餐厅   \n",
       "27  B0FFLJV97L          保利桃花源83栋       地名地址信息;门牌信息;楼栋号   \n",
       "28  B0HGD580NZ         广州南方学院惟贤门        科教文化服务;学校;高等院校   \n",
       "29  B0HR0GQOU0    中山大学南方学院继续教育学院        科教文化服务;学校;成人教育   \n",
       "\n",
       "                          tel direction distance              location  \\\n",
       "0                          []         北  470.792  113.679257,23.632577   \n",
       "1                          []         东   44.279  113.678689,23.628304   \n",
       "2                 13711245345        东南  231.223  113.680340,23.627566   \n",
       "3                 18028862548        东南  205.173  113.680097,23.627643   \n",
       "4                 13622768437        东南  102.617  113.678983,23.627778   \n",
       "5                          []        东北  285.635  113.679959,23.630496   \n",
       "6                 13712317721        东北  256.772  113.679965,23.630156   \n",
       "7                          []         北  298.093  113.677247,23.630947   \n",
       "8                          []         北  312.056  113.678698,23.631219   \n",
       "9                          []         北  244.566  113.678650,23.630612   \n",
       "10                13924024938        东北  260.939  113.679861,23.630285   \n",
       "11                18027267535        东北  311.024  113.680105,23.630681   \n",
       "12                         []        东北   386.65  113.680076,23.631502   \n",
       "13                         []        西北   393.93  113.676866,23.631736   \n",
       "14  020-61787368;020-61787371         北  444.196  113.679303,23.632322   \n",
       "15               020-61787222        西北  378.102  113.676330,23.631332   \n",
       "16                 4009200715        西北  419.018  113.676031,23.631594   \n",
       "17                         []         北  446.366  113.679041,23.632392   \n",
       "18      +861056320612,4618482        东北   424.35  113.681736,23.630569   \n",
       "19                         []        西北   405.49  113.675341,23.630898   \n",
       "20                         []        西北  450.091  113.675848,23.631818   \n",
       "21                15813395296         北  464.819  113.679226,23.632528   \n",
       "22                         []         北   471.03  113.679283,23.632574   \n",
       "23                         []         北  501.323  113.678800,23.632922   \n",
       "24                         []         北  484.588  113.679405,23.632673   \n",
       "25                         []        东北  554.129  113.682583,23.631487   \n",
       "26                         []         北  510.112  113.677160,23.632910   \n",
       "27                         []        东北   476.46  113.682290,23.630644   \n",
       "28                         []         北  587.601  113.678437,23.633721   \n",
       "29                         []         北  659.946  113.677666,23.634347   \n",
       "\n",
       "                                address poiweight businessarea  \n",
       "0                           温泉镇温泉大道882号  0.450402           []  \n",
       "1                     温泉镇温泉大道882号广州南方学院  0.233244           []  \n",
       "2                            中大南方学院南门1号  0.256152           []  \n",
       "3                 温泉镇平岗村乌土平岗街25号(中南公寓旁)  0.209893           []  \n",
       "4                     温泉镇乌土村松浪队5号(近博学路)  0.237309           []  \n",
       "5                              温泉大道886号  0.191595           []  \n",
       "6         笃行路20、22、24号广州南方学院商业中心1层1F015  0.209448           []  \n",
       "7                                博学路25号  0.191742           []  \n",
       "8                             博学路广州南方学院  0.191148           []  \n",
       "9                           温泉镇温泉大道882号  0.218221           []  \n",
       "10                               广州南方学院  0.224259           []  \n",
       "11  温泉镇笃行路20、22、24号中山大学南方学院商业中心一楼1F-005  0.218331           []  \n",
       "12                    温泉镇温泉大道882号广州南方学院  0.263595           []  \n",
       "13                      博学路与中山路交叉口南340米  0.191742           []  \n",
       "14                      温泉大道882号广州南方学院内  0.257947           []  \n",
       "15             温泉镇温泉大道882号广州南方学院H7栋1-5层  0.254885           []  \n",
       "16               温泉镇中山大学南方学院博学路6号西区食堂首层  0.214311           []  \n",
       "17                 温泉大道882号广州南方学院新综合楼2层  0.191229           []  \n",
       "18                                保利桃花源  0.273168           []  \n",
       "19                    温泉镇温泉大道882号广州南方学院  0.276093           []  \n",
       "20                       温泉镇广州南方学院博学路6号  0.182221           []  \n",
       "21             温泉镇博学路882号(广州南方学院商业中心1层)  0.317505           []  \n",
       "22                    温泉镇广州南方学院后门润泰超市1层  0.210069           []  \n",
       "23                  温泉大道882号广州南方学院行政楼1号  0.155825           []  \n",
       "24               温泉镇广州南方学院后门润泰超市1层05号商铺  0.230225           []  \n",
       "25                        从莞深高速(广州南方学院)  0.185371           []  \n",
       "26              温泉大道882号广州南方学院内博学路6号之3号  0.216026           []  \n",
       "27                                  温泉镇  0.106856           []  \n",
       "28                              博学路7号附近  0.285712           []  \n",
       "29                      博学路中山大学南方学院-行政楼  0.191158           []  "
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['regeocode']['pois'])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c20fc885",
   "metadata": {},
   "source": [
    "# 基于LBS环境下的 高德POI\n",
    "\n",
    "* 搜索服务API是一类简单的HTTP接口，提供多种查询POI信息的能力，其中包括关键字搜索、周边搜索、多边形搜索、ID查询四种筛选机制。\n",
    "\n",
    "> 1. 关键字搜索：通过用POI的关键字进行条件搜索，例如：肯德基、朝阳公园等；同时支持设置POI类型搜索，例如：银行\n",
    "> 1. 周边搜索：在用户传入经纬度坐标点附近，在设定的范围内，按照关键字或POI类型搜索；\n",
    "> 1. 多边形搜索：在多边形区域内进行搜索\n",
    "> 1. ID查询：通过POI ID，查询某个POI详情，建议可同输入提示API配合使用\n",
    "\n",
    "* 接口URL地址\n",
    "> https://restapi.amap.com/v3/place/text?parameters\n",
    "\n",
    "* 查询的两种参数：\n",
    "> 1. keywords(查询关键字)\n",
    "> 2. types(查询POI类型)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4fb31189",
   "metadata": {},
   "source": [
    "## 基于周边搜索\n",
    "\n",
    "* url地址：\n",
    "> https://restapi.amap.com/v3/place/around?parameters \n",
    "\n",
    "* 参数说明\n",
    "> 1. （必要）key\n",
    "> 1. （必要）location\n",
    "> 1. （可选细节）types\n",
    "> 1. （可选细节）keywords"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "90c9c008",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
